package com.zb.vo;

import com.zb.entity.ZjInstructionBook;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/1 0001
 **/
@Data
@ApiModel("说明书列表")
public class InstructionBookListVo {
    @ApiModelProperty(value = "说明书ID")
    private Long id;

    @ApiModelProperty(value = "说明名标题")
    private String name;

    @ApiModelProperty(value = "所属知识库类型")
    private String knowledgeType;

    @ApiModelProperty(value = "标题封面图片")
    private String image;

    @ApiModelProperty(value = "点击数量")
    private Integer clickNum;

    @ApiModelProperty(value = "说明书状态：false-否，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static InstructionBookListVo beanToVo(ZjInstructionBook book) {
        InstructionBookListVo vo = new InstructionBookListVo();
        BeanUtils.copyProperties(book, vo);
        vo.setStatus(book.getDisabled());
        vo.setCreateTime(book.getGmtCreate());
        vo.setUpdateTime(book.getGmtUpdate());
        return vo;
    }
}
